<template>
        <router-view></router-view>
</template>

<script setup>


// 从pinia中获取userInfo
import useUser from "../../store/users"

import { storeToRefs } from "pinia"

//引入路由组合式api

import { useRouter } from "vue-router"

let router = useRouter()

let userStore = useUser();

//嵌套解构
let { userInfo: { value: { nickname, headimgurl }  }} = storeToRefs(userStore)
// console.log(userInfo)
console.log(nickname)

//退出登入
let quit = () => {

    //清除token
    sessionStorage.removeItem('tk')

    //跳转到登入页
    router.push('/login')
}

</script>